// 这里封装的是对 mysql 的操作
const mysql = require("mysql");

function blog(sql, dataArr, backFun) {
  const connection = mysql.createConnection({
    host: "47.100.236.149",
    user: "root",
    password: "Ren123..",
    database: "blog",
  });

  connection.connect();
  connection.query(sql, dataArr, function (err, rows, fields) {
    backFun(err, rows, fields);
  });
  connection.end();
}

module.exports = { blog };
